﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Xpom_Xpum__Integrated_Development_Environment
{
    /// <summary>
    /// Interaction logic for SplashWindowView.xaml
    /// </summary>
    public partial class SplashWindowView : Window
    {
        #region Constructor

        public SplashWindowView()
        {
            InitializeComponent();
        }

        #endregion

        #region Commands

        #endregion

        #region Fields

        public const int WM_NCLBUTTONDOWN = 0xA1;
        public const int HT_CAPTION = 0x2;

        #endregion

        #region Properties

        #endregion

        #region Methods

        [DllImportAttribute("user32.dll")]
        public static extern int SendMessage(IntPtr hWnd,
                         int Msg, int wParam, int lParam);
        [DllImportAttribute("user32.dll")]
        public static extern bool ReleaseCapture();

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = System.Windows.WindowState.Minimized;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Environment.Exit(0);
        }

        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ReleaseCapture();
            WindowInteropHelper wih = new WindowInteropHelper(this);
            SendMessage(wih.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 6);
        }

        #endregion
    }
}
